using Tarantino.Samples.Core.Model;
using NUnit.Framework;

namespace Tarantino.Samples.Infrastructure.IntegrationTests.DataAccess.Mappings
{
	[TestFixture]
	public class SystemUserMappingTester : DatabaseTester
	{
		[Test]
		public void Can_persist_user()
		{
			SystemUser systemUser = new SystemUser();
			systemUser.FirstName = "John";
			systemUser.LastName = "Doe";
			systemUser.EmailAddress = "jdoe@hotmail.com";
			systemUser.EncryptedPassword = "EncryptedPassword";

			SaveAndFlushSessionFor(systemUser);
			SystemUser reloadedSystemUser = LoadFromDatabaseAndAssertMatchFor(systemUser);

			AssertObjectsMatch(systemUser, reloadedSystemUser);
		}
	}
}